Skip to content

Conversation

@gdt
Copy link

@gdt gdt commented Jan 6, 2026

There were many instances of an ifdef idiom checking for one of many Unix-like systems, and an else for Windows. This idiom fails to build on a new Unix-like system and needs significant edits.

Replace the list of systems with a "if this system is not windows" and an else, intending to have no code change on any system in the prior list, and extending portability to Unix-like systems not in the prior list.

In several places, an else clause -- for systems that aren't in the list and aren't windows -- was removed.

This commit (and dropping extending the conditionals to NetBSD) has survived build testing on NetBSD, and I'm running it on NetBSD/aarch64, apparently ok.

There were many instances of an ifdef idiom checking for one of many
Unix-like systems, and an else for Windows.  This idiom fails to build
on a new Unix-like system and needs significant edits.

Replace most instances of the list of systems with a "if this system
is not windows" and an else (for windows), intending to have no code
change on any system in the prior list, and extending portability to
Unix-like systems not in the prior list.

Another idiom is "if this is windows", followed by an else or if for a
list of Unix-like systems.  Replace this with a simple "if windows
else".

As part of this cleanup, in several places, an else clause -- for
systems that aren't in the list and aren't windows -- was removed.
This never made sense and is a bugfix.

In the one case where there is a correct "if linux or freebsd"
(ethernet.h include), explain why it's there and implicitly why it's
not a pattern to be extended to every new system.
@gdt gdt force-pushed the os-conditionals branch from a7a2857 to 2719899 Compare January 6, 2026 17:19
@gdt gdt marked this pull request as ready for review January 6, 2026 17:53
@gdt
Copy link
Author

gdt commented Jan 6, 2026

I think this is now at the point where it makes sense for review and merging. The ifdef situation was more complicated than I understood at first.

@connortechnology connortechnology merged commit 7ea6e5f into ZoneMinder:master Jan 9, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants